package com.eugene.ui.views.property;

import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.ui.views.properties.IPropertySource;

import com.eugene.element.MarketVariable;
import com.eugene.entity.Scenario;

public class EntityAdaptorFactory implements IAdapterFactory{
	
	public Object getAdapter(Object adaptableObject, Class adapterType) {
		if (adapterType == IPropertySource.class){
			if(adaptableObject instanceof Scenario){
				return new ScenarioProp((Scenario)adaptableObject);
			}
			else if (adaptableObject instanceof MarketVariable){
				System.out.println("Test3 :" + ((MarketVariable)adaptableObject).getMvId());
				return new MarketVariableProp((MarketVariable)adaptableObject);
			}
		}
		
		return null;
	}

	public Class[] getAdapterList() {
		return new Class[] {IPropertySource.class};
	}

}
